import 'package:flutter/material.dart';
import '../tools/smscontroller.dart';

class SettingsPage extends StatefulWidget {
  @override
  _SettingsPageState createState() => _SettingsPageState();
}

class _SettingsPageState extends State<SettingsPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("隐私设置"),
        leading: IconButton(
          icon: Icon(Icons.arrow_back),
          onPressed: () {
            Navigator.pop(context);
          },
        ),
      ),
      body: ValueListenableBuilder<bool>(
        valueListenable: GlobalState.isLoggedIn,
        builder: (context, isLoggedIn, child) {
          return ListView(
            padding: EdgeInsets.zero,
            children: <Widget>[
              if (isLoggedIn)
                ListTile(
                  title: Text('黑名单'),
                  trailing: Icon(Icons.keyboard_arrow_right),
                  onTap: () {
                    Navigator.pushNamed(context, '/blacklist');
                  }, // 添加相应的点击事件
                ),
              ListTile(
                title: Text('用户协议'),
                trailing: Icon(Icons.keyboard_arrow_right),
                onTap: () {}, // 添加相应的点击事件
              ),
              ListTile(
                title: Text('隐私政策'),
                trailing: Icon(Icons.keyboard_arrow_right),
                onTap: () {
                  Navigator.pushNamed(context, '/feedback');
                }, // 添加相应的点击事件
              ),
            ],
          );
        },
      ),
    );
  }
}
